ngl Fix bottom-right border render failure
authorBenjamin Otte <otte@redhat.com>
Thu, 16 Sep 2021 00:28:56 +0000 (02:28 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 16 Sep 2021 21:59:37 +0000 (23:59 +0200)
The wrong index was used for offsetting the bottom border rect.

Test included.

gsk/ngl/gsknglrenderjob.c
testsuite/gsk/compare/border-bottom-right.node [new file with mode: 0644]
testsuite/gsk/compare/border-bottom-right.png [new file with mode: 0644]
testsuite/gsk/meson.build

index f819ac8d31fb633d69ca4b9c1b83a607ff7ff26b..63da37b64305578500e57153f4fcb10030bb9e29 100644 (file)
@@ -1734,7 +1734,7 @@ gsk_ngl_render_job_visit_rect_border_node (GskNglRenderJob     *job,
     {
       rgba_to_half (&colors[2], color);
       gsk_ngl_render_job_draw_rect_with_color (job,
-                                               &GRAPHENE_RECT_INIT (origin->x + widths[3], origin->y + size->height - widths[2], size->width - widths[1], widths[2]),
+                                               &GRAPHENE_RECT_INIT (origin->x + widths[3], origin->y + size->height - widths[2], size->width - widths[3], widths[2]),
                                                color);
     }
 
diff --git a/testsuite/gsk/compare/border-bottom-right.node b/testsuite/gsk/compare/border-bottom-right.node
new file mode 100644 (file)
index 0000000..d71790a
--- /dev/null
@@ -0,0 +1,5 @@
+border {
+  colors: red;
+  outline: 0 0 20 20;
+  widths: 0 10 10 0;
+}
diff --git a/testsuite/gsk/compare/border-bottom-right.png b/testsuite/gsk/compare/border-bottom-right.png
new file mode 100644 (file)
index 0000000..579f7ef
Binary files /dev/null and b/testsuite/gsk/compare/border-bottom-right.png differ
index 5ba5f735204ba14f7056c3aca04b75fa8475e3e0..a857646752a50c6890a00da77f6de4baf867ce93 100644 (file)
@@ -23,6 +23,7 @@ compare_render_tests = [
   'blend-difference',
   'blend-invisible-child',
   'blend-normal',
+  'border-bottom-right',
   'borders-rotated',
   'borders-scaled',
   'clip-coordinates-2d',